%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% computeDistanceFunction2d() computes a distance from an 
% arbitrary level set function in two-dimensions using the 
% Fast Marching Method.
% 
% Usage: distance_fcn = computeDistanceFunction2d(phi, dX, ...
%                                                 mask, ...
%                                                 spatial_derivative_order)
%
% Arguments:
% - phi:                       level set function to use in 
%                                computing distance function
% - dX:                        array containing the grid spacing
%                                in each coordinate direction
% - mask:                      mask for domain of problem;
%                                grid points outside of the domain
%                                of the problem should be set to a
%                                negative value
%                                (default = [])
% - spatial_derivative_order:  order of discretization for 
%                                spatial derivatives
%                                (default = 5)
%
% Return value:
% - distance_fcn:              distance function
%
% NOTES:
% - All data arrays are assumed to be in the order generated by the 
%   MATLAB meshgrid() function.  That is, data corresponding to the 
%   point (x_i,y_j) is stored at index (j,i) in the data array.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Author:     Kevin T. Chu
% Copyright:  (c) 2005-2006, MAE Princeton University
% Revision:   $Revision: 1.5 $
% Modified:   $Date: 2006/09/18 16:17:01 $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

